import torch


class ProjectConfig(object):
    def __init__(self):
        # windows电脑/linux服务器
        self.device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
        # self.device = "mps:0"  # MAC电脑
        self.pre_model = r'E:\AIStudy\11第十一阶段\code\my_code\BERT_Prompt_Tuning\pre_model\bert-base-chinese'
        self.train_path = './data/train.txt'
        self.dev_path = './data/dev.txt'
        self.prompt_file = './data/prompt.txt'
        self.verbalizer = './data/verbalizer.txt'
        self.max_seq_len = 512  # 句子的最大长度，若没有达到最大长度，则padding为最大长度
        self.max_label_len = 2  # 最大label标签长度
        self.batch_size = 8  # 批次大小
        self.learning_rate = 5e-5  # 学习率
        self.weight_decay = 0.01  # 权重衰减系列（正则化，抑制模型过拟合）
        self.warmup_ratio = 0.06  # 预热率（用来定义预热的步数）
        self.epochs = 20  # 轮次
        self.logging_steps = 4  # 打印日志步数
        self.valid_steps = 20  # 验证步数
        self.save_dir = './checkpoints'


if __name__ == '__main__':
    pc = ProjectConfig()
    print(pc.device)
    print(pc.pre_model)
    print(pc.prompt_file)

    gpu_available = torch.cuda.is_available()
    print(gpu_available)
    gpu_count = torch.cuda.device_count()
    print(gpu_count)
